package com.slz3.business.module.wmsManagement.wmsStockOutItems.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.wmsManagement.wmsStockOutItems.domain.WmsStockOutItems;
import com.slz3.business.module.wmsManagement.wmsStockOutItems.domain.WmsStockOutItemsCondition;
import org.springframework.stereotype.Controller;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

import javax.annotation.Resource;

public class WmsStockOutItemsResController extends WmsStockOutItemsResAtomic {

    public Mono<ServerResponse> add(ServerRequest req, WmsStockOutItems wmsStockOutItems) {
        if (WmsStockOutItemsResUnsafeValid.add(req, wmsStockOutItems)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.add_$WmsStockOutItemsUpdateLock(req, wmsStockOutItems);
        }
    }

    public Mono<ServerResponse> delete(ServerRequest req, WmsStockOutItemsCondition wmsStockOutItemsCondition) {
        if (WmsStockOutItemsResUnsafeValid.delete(req, wmsStockOutItemsCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.delete_$WmsStockOutItemsUpdateLock(req, wmsStockOutItemsCondition);
        }
    }

    public Mono<ServerResponse> modify(ServerRequest req, WmsStockOutItems wmsStockOutItems) {
        if (WmsStockOutItemsResUnsafeValid.modify(req, wmsStockOutItems)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.modify_$WmsStockOutItemsUpdateLock(req, wmsStockOutItems);
        }
    }

    public Mono<ServerResponse> list(ServerRequest req) {
        if (WmsStockOutItemsResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.list(req);
        }
    }

    public Mono<ServerResponse> info(ServerRequest req) {
//        return wmsStockOutItemsResAtomic.info_$WmsStockOutItemsUpdateLock(req);
        if (WmsStockOutItemsResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.info_$WmsStockOutItemsUpdateLock(req);
        }
    }

    public Mono<ServerResponse> choice(ServerRequest req) {
        if (WmsStockOutItemsResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.choice(req);
        }
    }

    public Mono<ServerResponse> auditSubmit(ServerRequest req, WmsStockOutItemsCondition wmsStockOutItemsCondition) {
        //
        if (WmsStockOutItemsResUnsafeValid.auditSubmit(req, wmsStockOutItemsCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.auditSubmit_$WmsStockOutItemsUpdateLock(req, wmsStockOutItemsCondition);
        }
    }

    public Mono<ServerResponse> audit(ServerRequest req, WmsStockOutItemsCondition wmsStockOutItemsCondition) {
        if (WmsStockOutItemsResUnsafeValid.audit(req, wmsStockOutItemsCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.audit_$WmsStockOutItemsUpdateLock(req, wmsStockOutItemsCondition);
        }
    }

    public Mono<ServerResponse> auditReject(ServerRequest req, WmsStockOutItemsCondition wmsStockOutItemsCondition) {
        if (WmsStockOutItemsResUnsafeValid.auditReject(req, wmsStockOutItemsCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.auditReject_$WmsStockOutItemsUpdateLock(req, wmsStockOutItemsCondition);
        }
    }

    public Mono<ServerResponse> usingEnable(ServerRequest req, WmsStockOutItemsCondition wmsStockOutItemsCondition) {
        if (WmsStockOutItemsResUnsafeValid.usingEnable(req, wmsStockOutItemsCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.usingEnable_$WmsStockOutItemsUpdateLock(req, wmsStockOutItemsCondition);
        }
    }

    public Mono<ServerResponse> usingDisable(ServerRequest req, WmsStockOutItemsCondition wmsStockOutItemsCondition) {
        if (WmsStockOutItemsResUnsafeValid.usingDisable(req, wmsStockOutItemsCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.usingDisable_$WmsStockOutItemsUpdateLock(req, wmsStockOutItemsCondition);
        }
    }

}
